<script type="text/javascript" src="<?php echo $this->baseUrl() ;?>/public/scripts/functionchat/ui/js/FusionCharts.js"></script>
<link rel="stylesheet" type="text/css" href="<?php echo $this->baseUrl() ;?>/public/css/index.css" media="screen" />
<script src="<?php echo $this->baseUrl() ;?>/public/scripts/lienhe.js" type="text/javascript"></script>
<div class ="conten" >

    <table cellpadding="0"  cellspacing="0" class="tableconten" border="0">
        <tr>
          <td> <!--  Start td ben trai -->
          	<div class= "column ">
		    		<div class= 'portlet'> 
		    			<div class="portlet-header">Thống kê số lượng thư</div>
	                    <div class=" portlet-content">
	                        <?php
	                        $arrData[0][1] = "Thư gửi";
	                        $arrData[1][1] = "Thư nháp";
	                        $arrData[2][1] = "Thư mẫu";
	                        //$arrData[3][1] = "Product D";
	                       // $arrData[4][1] = "Product E";
	                        //$arrData[5][1] = "Product F";
	                        //Store sales data
	                        $arrData[0][2] = $this->thudagu;
	                        $arrData[1][2] = $this->thunhap;
	                        $arrData[2][2] = $this->thumau;
	                        //$arrData[3][2] = 734500;
	                       // $arrData[4][2] = 676800;
	                        //$arrData[5][2] = 648500;
	                        //Now, we need to convert this data into XML. We convert using string concatenation.
	                        //Initialize <chart> element
	                        $strXML = "<chart caption='Thống kê số lượng thư' numberPrefix='' formatNumberScale='100'>";
	                        //Convert data to XML and append
	                        foreach ($arrData as $arSubData)
	                            $strXML .= "<set label='" . $arSubData[1] . "' value='" . $arSubData[2] . "' />";
	                        //Close <chart> element
	                        $strXML .= "</chart>";
	                        //Create the chart - Column 3D Chart with data contained in strXML
	                        echo renderChart("".$this->baseUrl()."/scripts/functionchat/ui/Column3D.swf", "", $strXML, "productSales", 450, 198, false, false);
	                        ?>
	                    </div>
	                  </div>
	                  
	                  
	                  <!--  Biểu đồ số 2 -->
                      <div class= 'portlet'> 
	                     <div class="portlet-header">Nhóm Liên hệ</div>
	                     <div class="portlet-content">
	                        <?php
		                        //We first request the data from the form (Default.php)
		                        $strXMLlh = "<chart caption='Nhóm Liên hệ' subCaption='' showPercentValues='1' pieSliceDepth='30' showBorder='1'>";
		                        //Add all data
	                       	     foreach ($this->thonhkenhonlh as $nhonlienhe){
							         $strXMLlh .= "<set label='" . $nhonlienhe['ten_nhom_lh'] . "' value='" . $nhonlienhe['tonglienhe'] . "' />";
							     }
		                        $strXMLlh .= "</chart>";
		                        //Create the chart - Pie 3D Chart with data from $strXML
	                        echo renderChart("".$this->baseUrl()."/scripts/functionchat/ui/Pie3D.swf", "", $strXMLlh, "Sales", '450', 200, false, false);
	                        ?>
	
	                    </div>
	                  </div>  
	                  <!--  End bieu do so 2 -->
	                  
	           </div>              
          	<!--  Bên phải -->
          	    <div class= "column dulieudb">
					<!-- Nội dung liên hệ  -->	          	    
          	    	<div class="portlet  ">
						<div class="portlet-header ">Liên hệ mới</div>
						<div class="portlet-content "> 
						 <div class="box-l-n-body"> <!-- start div table  -->
					 	   <div class="box-l-n-wrr">
							<table cellspacing="1" id="danhsach_lienhe">
								<thead>
								<tr align="center">
									<th width="20%" ><b>Tên Liên hệ </b></th>
									<td width="3%"> <img  title="Liên hệ quan trọng " src="<?php echo  $this->baseUrl()?>/public/images/icon/flag-16.png"> </td>
									<td width="20%" ><b>Nhóm liên hệ </b></td>
									<td width="15%"><b>Email</b></td>
								</tr>
								</thead>
								<tbody>
								<?php foreach ($this->lienhedb as $lienhe){?>
								<tr class="row_">
									<td width="20%" >
										 <b><?php echo $lienhe['tenlh']?></b>
									</td>
									<td width="3%" align="center">
									<?php if($lienhe['flag'] == 0){ ?>
										<a href="#"><span id="laco_<?php echo  $lienhe['idlh'] ?>" > <img  onclick="thaydoitrangthailienhe(<?php echo  $lienhe['idlh'] ?>,1)" title="Thay đổi trạng thái " src="<?php echo  $this->baseUrl()?>/public/images/icon/flag-16-d.png"> </span></a>
									<?php }else{?>
										<a href="#"><span id="laco_<?php echo  $lienhe['idlh'] ?>" > <img  onclick="thaydoitrangthailienhe(<?php echo  $lienhe['idlh'] ?>,0)" title="Thay đổi trạng thái" src="<?php echo  $this->baseUrl()?>/public/images/icon/flag-16.png"> </span></a>
									<?php }?>									
									</td>
									<td width="20%" align="left">
										<?php echo $lienhe['ten_nhom_lh']?>
								    </td>
								    <td width="15%">
								    	<?php echo $lienhe['email']?>
								    </td>
									</td>

								</tr>
								<?php }?>
													
								</tbody>
							</table>
						   </div>
						  </div> <!-- end div table  --> 	
						</div>
					</div>
					<!--  end noi dung lien hệ  -->
					
					
					<!--  Start thư đã gửi -->
					<div class="portlet ">
						<div class="portlet-header">Thư mới gửi</div>
						<div class="portlet-content">
							 <div class="box-l-n-body"> <!-- start div table  -->
						 	   <div class="box-l-n-wrr">
								<table cellspacing="1" id="danhsach_lienhe">
									<thead>
									<tr align="center">
										<th width="40%" ><b>Chủ đề  </b></th>
										<td width="20%" ><b>Files đính kèm  </b></td>
										<td width="20%"><b>Ngày gửi </b></td>
										
									</tr>
									</thead>
									<tbody>
										<?php foreach ($this->thudagui as $thudagui ){?>
										<tr class="row_<?php echo  $thudagui['id_tg'] ?>">
											<td width="40%" >
												<a href="#" onclick= "vewthudagui('<?php echo  $thudagui['id_tg'] ?>');"> <b><?php echo $thudagui['tieu_de'] ?></b></a>
											</td>
											<td width="20%" align="center">
												<img src="<?php echo $this->baseUrl()?>/images/icon/attach_2.png" />(<?php echo $thudagui['tong_files']?>)
										    </td>
											<td width="20%" align="center">
												<?php echo $thudagui['ngay_tao']?>
											</td>
										</tr>
										<?php }?>	
														
									</tbody>
								</table>
							   </div>
							  </div> <!-- end div table  --> 							
							
						</div>
					</div>
					<!--  End nội dung th  -->

		    	</div>          
          
          
          
          </td><!--  emd td ben phai -->
          
            
        </tr>
    
    </table>
    
</div>
<!--  In put an  -->
<input type="hidden" value="<?php echo $this->baseUrl()?>" id="url"/>
<input type="hidden" value="<?php echo $this->iddangnhap;?>" id="iddn"/>
<!--  In put an  -->
<script type="text/javascript" >
$(document).ready(function(){
	$(function() {
		$( ".column" ).sortable({
			connectWith: ".column"
		});

		$( ".portlet" ).addClass( "ui-widget ui-widget-content ui-helper-clearfix ui-corner-all" )
			.find( ".portlet-header" )
				.addClass( "ui-widget-header ui-corner-all" )
				.prepend( "<span class='ui-icon ui-icon-minusthick'></span>")
				.end()
			.find( ".portlet-content" );

		$( ".portlet-header .ui-icon" ).click(function() {
			$( this ).toggleClass( "ui-icon-minusthick" ).toggleClass( "ui-icon-plusthick" );
			$( this ).parents( ".portlet:first" ).find( ".portlet-content" ).toggle();
		});

		$( ".column" ).disableSelection();
				
	});


	
	
});	
</script>